package com.jili.controller;

import com.jili.annotation.Autowired;
import com.jili.annotation.Component;
import com.jili.annotation.RequestMapping;
import com.jili.annotation.ResponseBody;
import com.jili.service.UserService;

/**
 *  ClassName: UserController
 *  Package com.com.jili.controller
 *  Description:
 *  @Author: 廖继礼
 *  @Create: 2025/6/5
 *  @Version: v1.0
 *
 */
@Component
public class UserController {

    @Autowired
    private UserService userService;


    @RequestMapping("/user")
    public String getUserPage() {
        return "user: " + userService.getUser();
    }

    @RequestMapping("/api/user")
    @ResponseBody
    public String getUserApi() {
        return "{\"name\":\"" + userService.getUsers() + "\"}";
    }
}
